<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsOrderDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_order_details', function (Blueprint $table) {
            $table->id();
            $table->string('order_num')->comment("订单号");
            $table->unsignedInteger('sku_id')->comment("skuid");
            $table->string('sku')->comment("sku");
            $table->unsignedInteger('goods_id')->comment("商品id");
            $table->double('price', 12, 4)->comment("商品单价");
            $table->string('title')->comment("商品标题");
            $table->unsignedInteger("num")->default(0)->comment("商品数量");
            $table->string('image')->comment("商品图片");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_order_details');
    }
}
